﻿#include <stdbool.h>

typedef struct{
	double* values;
	int top;
	int maxTop;
} Stack;

bool CreateStack(Stack *stack, int size);
//Creates an empty stack whose capacity is size

bool IsEmpty(Stack* stack);
//Returns true if the stack is empty and false otherwise

bool IsFull(Stack* stack);
//Returns true if the stack is full and false otherwise

bool Top(Stack* stack, double* x);
//Returns true if the operation is successful and false otherwise
//Passes the value of the top element to x

bool Push(Stack* stack, double x);
//Add a new element with value x to the top of the stack
//Returns true if the operation is successful and false otherwise

bool Pop(Stack* stack, double* x);
//Remove an element from the top of the stack
//Returns true if the operation is successful and false otherwise
//Passes the value of the top element to x

void DisplayStack(Stack* stack);
//Display the elements in stack from top to bottom

void DestroyStack(Stack** pstack);
//Frees the memory occupied by the stack values and stack struct
//Point the stack to NULL
